import { mapMutations } from 'vuex';

export const windowCtrl = {
  mounted() {
    window.addEventListener('message', (e)=>{
      if(e.data.mutation&&(e.data.mutation!='destroy'||e.data.mutation!='destroyAll')){
        this[e.data.mutation](e.data.value)
      }
    })
  },
  methods:{
    ...mapMutations('setting', ['setSize', 'setAnimate', 'setFileResolve', 'setLang', 'setRecycleBin','setSoundEffect','setThumbnail','setFileCheck','setWallpaper','setTheme','setWeekMode','setIconSize','setStoreStatus']),
  }
}